/**
 * 大数相加
 * @param {string} num1 
 * @param {string} num2 
 * @returns {string}
 */
function addBigNumber(num1, num2) {
  let carry = 0;
  let result = '';
  let len1 = num1.length;
  let len2 = num2.length;
  let maxLen = Math.max(len1, len2);
  for (let i = 0; i < maxLen; i++) {
    let x = i < len1 ? parseInt(num1.charAt(len1 - 1 - i)) : 0;
    let y = i < len2 ? parseInt(num2.charAt(len2 - 1 - i)) : 0;
    let sum = x + y + carry;
    carry = Math.floor(sum / 10);
    result = (sum % 10) + result;
  }
  if (carry) {
    result = carry + result;
  }
  return result;
}

